package com.itheima.health.rocketMQListener;

import com.itheima.health.common.RocketMqConst;
import com.itheima.health.pojo.SmsTask;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author: jinbi
 * @Date: 9:10 2021/1/20
 * @Description: RocketMQConsumer模拟发送短信
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConst.TOPIC_SMS_SEND,consumerGroup = "sms-send-consumer")
public class SmsSendConsumer implements RocketMQListener<SmsTask> {
    @Override
    public void onMessage(SmsTask smsTask) {
        log.debug("[短信发送消费者]received message: {}", smsTask);
        log.debug("[短信发送消费者]模拟发送，发送中……");
        log.debug("[短信发送消费者]发送成功");
    }
}
